package com.tkc.common.result;

import com.tkc.common.enums.BaseResultCodeEnum;

/**
 * 
 * @Function:单个对象的返回结果
 * 
 * @Project :assessmenttask 
 * @Package :com.tkc.common.result 
 * @File :SingleResult.java 
 * @ClassName: SingleResult  
 * 
 * @author tankaichao 
 * @email cgztkc@126.com 
 * @Date 2016年8月9日下午7:01:47
 * @since JDK 1.8 
 *
 */
public class SingleResult<T> extends CommonResult {

    /** serialVersionUID */
    private static final long serialVersionUID = 807003977989498433L;

    /** 结果对象 */
    private T                 data;

    /**
     * 默认构造函数
     */
    public SingleResult() {
    }

    /**
     * 构造函数
     * 
     * @param resultCodeEnum 结果编码
     */
    public SingleResult(BaseResultCodeEnum baseResultCodeEnum, T data) {
        setSuccess(baseResultCodeEnum == BaseResultCodeEnum.ERR_CODE_200);
        setResultCode(baseResultCodeEnum.getCode());
        setResultMsg(baseResultCodeEnum.getMsg());
        setData(data);
    }

	/**
     * Getter method for property <tt>data</tt>.
     * 
     * @return property value of data
     */
    public T getData() {
        return data;
    }

    /**
     * Setter method for property <tt>data</tt>.
     * 
     * @param data value to be assigned to property data
     */
    public void setData(T data) {
        this.data = data;
    }

}
